<!DOCTYPE html>
<html>

<head>
    <title>Example</title>
    <!-- lifehacker.com-------js启蒙读物
        使用说明参见:http://lifehacker.com/5744113/learn-to-code-the-full-beginners-guide
        《JavaScript权威指南(第六版)》, 机械工业出版社
        《JavaScript设计模式》, 人民邮电出版社
    -->
</head>

<body>
    <!-- script位于文档中其他内容之后, 
        这样一来在脚本执行之前浏览器就已经对其他元素进行了解析 -->
    <script type="text/javascript">
        var myData1 = 5;
        var myData2 = "5";
        // myData3 是myData2的引用
        var myData3 = myData2;

        var test1 = myData1 == myData2;
        var test2 = myData2 == myData3;
        var test3 = myData1 === myData2;
        var test4 = myData2 === myData3;

        document.writeln("Test 1: " + test1 + " Test 2: " + test2);
        document.writeln("Test 3: " + test3 + " Test 4: " + test4);
    </script>
</body>

</html>